{{$config := $.Stored.captcha}}
<div class="form-group">
    <label class="col-sm-2 control-label">{{"验证码类型"|$.T}}</label>
    <div class="col-sm-10">{{$type := $config.type.Value|Default `default`}}
        <div class="radio radio-primary radio-inline">
            <input type="radio" name="captcha[type][value]" value="default"{{if eq $type `default` ``}} checked{{end}} id="captcha-type-default">
            <label for="captcha-type-default">{{"内置默认"|$.T}}</label>
        </div>
        <div class="radio radio-primary radio-inline">
            <input type="radio" name="captcha[type][value]" value="go"{{if eq $type `go`}} checked{{end}} id="captcha-type-go">
            <label for="captcha-type-go">{{"行为验证码"|$.T}}</label>
        </div>
        <div class="radio radio-primary radio-inline">
            <input type="radio" name="captcha[type][value]" value="api"{{if eq $type `api`}} checked{{end}} id="captcha-type-api">
            <label for="captcha-type-api">{{"第三方接口"|$.T}}</label>
        </div>
    </div>
</div>
<div class="form-group" id="settings-captcha-api"{{if eq $type `api`}} style="display:none"{{end}}>
    <label class="col-sm-2 control-label">{{"服务商"|$.T}}</label>
    {{- $provider := $config.api.ValueObject.provider|Default `turnstile` -}}
    <div class="col-sm-10">
        <div class="radio radio-primary radio-inline">
            <input type="radio" name="captcha[api][value][provider]" value="turnstile"{{if eq $provider `turnstile` ``}} checked{{end}} id="captcha-api-provider-turnstile">
            <label for="captcha-api-provider-turnstile">Cloudflare Turnstile</label>
        </div>
        <div class="radio radio-primary radio-inline">
            <input type="radio" name="captcha[api][value][provider]" value="recaptcha"{{if eq $provider `recaptcha`}} checked{{end}} id="captcha-api-provider-recaptcha">
            <label for="captcha-api-provider-recaptcha">Google Recaptcha(V3)</label>
        </div>

        <div class="fieldset bg-fc" id="settings-captcha-api-turnstile">
            <div class="form-group">
                <label class="col-sm-2 control-label">{{"站点密钥"|$.T}}</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="captcha[api][value][turnstile][siteKey]" value="{{$config.api.ValueObject.turnstile.siteKey}}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{{"密钥"|$.T}}</label>
                <div class="col-sm-10">
                    <span class="input-group">
                    <input type="password" class="form-control" name="captcha[api][value][turnstile][secret]" value="{{$config.api.ValueObject.turnstile.secret}}" autocomplete="off">
                    <span class="input-group-btn">
                    <a href="javascript:;" data-target="[name='captcha[api][value][turnstile][secret]']" class="btn btn-default show-password">
                      <i class="fa fa-eye"></i>
                      {{`查看`|$.T}}
                    </a>
                    </span>
                    </span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{{"验证IP"|$.T}}</label>
                {{- $verifyIP := $config.api.ValueObject.turnstile.verifyIP|Default `0` -}}
                <div class="col-sm-4">
                    <div class="radio radio-success radio-inline">
                        <input type="radio" name="captcha[api][value][turnstile][verifyIP]" value="1"{{if eq $verifyIP `1`}} checked{{end}} id="captcha-api-turnstile-verifyIP-1">
                        <label for="captcha-api-turnstile-verifyIP-1">{{`验证`|$.T}}</label>
                    </div>
                    <div class="radio radio-danger radio-inline">
                        <input type="radio" name="captcha[api][value][turnstile][verifyIP]" value="0"{{if eq $verifyIP `0`}} checked{{end}} id="captcha-api-turnstile-verifyIP-0">
                        <label for="captcha-api-turnstile-verifyIP-0">{{`不验证`|$.T}}</label>
                    </div>
                </div>
            </div>
        </div>

        <div class="fieldset bg-fc" id="settings-captcha-api-recaptcha">
            <div class="form-group">
                <label class="col-sm-2 control-label">{{"站点密钥"|$.T}}</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="captcha[api][value][recaptcha][siteKey]" value="{{$config.api.ValueObject.recaptcha.siteKey}}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{{"密钥"|$.T}}</label>
                <div class="col-sm-10">
                    <span class="input-group">
                    <input type="password" class="form-control" name="captcha[api][value][recaptcha][secret]" value="{{$config.api.ValueObject.recaptcha.secret}}" autocomplete="off">
                    <span class="input-group-btn">
                    <a href="javascript:;" data-target="[name='captcha[api][value][recaptcha][secret]']" class="btn btn-default show-password">
                      <i class="fa fa-eye"></i>
                      {{`查看`|$.T}}
                    </a>
                    </span>
                    </span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{{"最低评分"|$.T}}</label>
                <div class="col-sm-4">
                    <input type="number" class="form-control" name="captcha[api][value][recaptcha][minScore]" value="{{$config.api.ValueObject.recaptcha.minScore|Default `0.5`}}" min="0.00" step="0.01" max="1.00">
                    <div class="help-block">{{`取值范围`|$.T}} 0.00 ~ 1.00</div>
                </div>
                <label class="col-sm-2 control-label">{{"验证IP"|$.T}}</label>
                {{- $verifyIP := $config.api.ValueObject.recaptcha.verifyIP|Default `0` -}}
                <div class="col-sm-4">
                    <div class="radio radio-success radio-inline">
                        <input type="radio" name="captcha[api][value][recaptcha][verifyIP]" value="1"{{if eq $verifyIP `1`}} checked{{end}} id="captcha-api-recaptcha-verifyIP-1">
                        <label for="captcha-api-recaptcha-verifyIP-1">{{`验证`|$.T}}</label>
                    </div>
                    <div class="radio radio-danger radio-inline">
                        <input type="radio" name="captcha[api][value][recaptcha][verifyIP]" value="0"{{if eq $verifyIP `0`}} checked{{end}} id="captcha-api-recaptcha-verifyIP-0">
                        <label for="captcha-api-recaptcha-verifyIP-0">{{`不验证`|$.T}}</label>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="form-group" id="settings-captcha-go"{{if eq $type `go`}} style="display:none"{{end}}>
    <label class="col-sm-2 control-label">{{"行为模式"|$.T}}</label>
    {{- $driver := $config.go.ValueObject.driver|Default `click` -}}
    <div class="col-sm-10">
        <div class="radio radio-primary radio-inline">
            <input type="radio" name="captcha[go][value][driver]" value="click"{{if eq $driver `click` ``}} checked{{end}} id="captcha-go-driver-click">
            <label for="captcha-go-driver-click">{{`点击模式`|$.T}}</label>
        </div>
        <div class="radio radio-primary radio-inline">
            <input type="radio" name="captcha[go][value][driver]" value="slide"{{if eq $driver `slide`}} checked{{end}} id="captcha-go-driver-slide">
            <label for="captcha-go-driver-slide">{{`拼图模式`|$.T}}</label>
        </div>
        <div class="radio radio-primary radio-inline">
            <input type="radio" name="captcha[go][value][driver]" value="rotate"{{if eq $driver `rotate`}} checked{{end}} id="captcha-go-driver-rotate">
            <label for="captcha-go-driver-rotate">{{`旋转模式`|$.T}}</label>
        </div>

        {{- $type := $config.go.ValueObject.click.type|Default `basic` -}}
        <div class="fieldset bg-fc" id="settings-captcha-go-click">
            <div class="form-group">
                <label class="col-sm-2 control-label">{{"类型"|$.T}}</label>
                <div class="col-sm-10">
                    <div class="radio radio-primary radio-inline">
                        <input type="radio" name="captcha[go][value][click][type]" value="basic"{{if eq $type `basic`}} checked{{end}} id="captcha-go-click-basic">
                        <label for="captcha-go-click-basic">{{`文本点选`|$.T}}</label>
                    </div>
                    <div class="radio radio-primary radio-inline">
                        <input type="radio" name="captcha[go][value][click][type]" value="shape"{{if eq $type `shape`}} checked{{end}} id="captcha-go-click-shape">
                        <label for="captcha-go-click-shape">{{`图形点选`|$.T}}</label>
                    </div>
                </div>
            </div>
        </div>

        {{- $type := $config.go.ValueObject.slide.type|Default `basic` -}}
        <div class="fieldset bg-fc" id="settings-captcha-go-slide">
            <div class="form-group">
                <label class="col-sm-2 control-label">{{"操作方式"|$.T}}</label>
                <div class="col-sm-10">
                    <div class="radio radio-primary radio-inline">
                        <input type="radio" name="captcha[go][value][slide][type]" value="basic"{{if eq $type `basic`}} checked{{end}} id="captcha-go-slide-basic">
                        <label for="captcha-go-slide-basic">{{`滑动`|$.T}}</label>
                    </div>
                    <div class="radio radio-primary radio-inline">
                        <input type="radio" name="captcha[go][value][slide][type]" value="region"{{if eq $type `region`}} checked{{end}} id="captcha-go-slide-region">
                        <label for="captcha-go-slide-region">{{`拖拽`|$.T}}</label>
                    </div>
                </div>
            </div>
        </div>

        {{- $type := $config.go.ValueObject.rotate.type|Default `basic` -}}
        <div class="fieldset bg-fc" id="settings-captcha-go-rotate">
            <div class="form-group">
                <label class="col-sm-2 control-label">{{"操作方式"|$.T}}</label>
                <div class="col-sm-10">
                    <div class="radio radio-primary radio-inline">
                        <input type="radio" name="captcha[go][value][rotate][type]" value="basic"{{if eq $type `basic`}} checked{{end}} id="captcha-go-rotate-basic">
                        <label for="captcha-go-rotate-basic">{{`滑动`|$.T}}</label>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>